﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace CantinhodaCegonha.Services
{
    static class EncryptionHelper
    {
        public static string EncryptPassword(string pwd)
        {
            var provider = (IEncryptionProvider)Membership.Provider;
            return provider.EncodePassword(pwd);
        }

        public static string DecryptPassword(string pwd)
        {
            var provider = (IEncryptionProvider)Membership.Provider;
            return provider.UnEncodePassword(pwd);
        }
    }

    public interface IEncryptionProvider
    {
        string EncodePassword(string clearPassword);
        string UnEncodePassword(string encodedPassword);
    }

}
